<template>
	<view class="content">
		<h4>周一周四·新品首发</h4>
		<view class="bigimg">
			<view class="imgs" v-for="item in newGoodsList">
				<u-image class="img" width="300rpx" height="300rpx" :src="item.list_pic_url"></u-image>
				<view class="nameprice">
					<text>{{item.name}}</text>
					<view>{{item.retail_price}}</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		name: "Newproduct",
		data() {
			return {
				newGoodsList: []
			}
		},
		created() {

			this.$request({
				url: 'index/index',
				// 设想 在这里有一个成功的回调函数去处理接口返回来的数据

				successCb: (res) => {
					let {
						newGoodsList
					} = res
					this.newGoodsList = newGoodsList
					// console.log(this.newGoodsList);
				},

				failCb: () => {
					// 处理请求失败
				}
			})
		}
	}
</script>

<style lang="scss">
	h4 {
		text-align: center;
		font-size: 18px;
	}

	.bigimg {
		display: flex;
		flex-wrap: wrap;
		margin: 10px 30px;
		justify-content: space-between;
	}

	.nameprice {
		text-align: center;
		// display: flex;
		// align-items: center;
	}
</style>
